<?php
    $tmp = debug_backtrace();
    $include_me = preg_replace('|^.*/|i', '', $tmp[0]['file']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="../style/wp.css" rel="stylesheet" type="text/css" />
    </head>
<body>
    <div id="header"> <div class="wrapper">
        <h1>Feli Online Judge</h1>
        <ul>
            <li><a <?php if ($include_me == "index.php") echo 'class="current"'; ?> href="index">Home</a></li>
            <li><a <?php if ($include_me == "user.php") echo 'class="current"'; ?> href="user">User List</a></li>
            <li><a <?php if ($include_me == "validate_user.php") echo 'class="current"'; ?> href="validate_user">Validate User</a></li>
            <li>
                <?php
                    echo '<a ';
                    if (isset($_SESSION['admin'])) {
                        if ($include_me == "login.php") echo 'class="current"';
                        echo ' href="logout.do">Logout';
                    }
                    else {
                        if ($include_me == "login.php") echo 'class="current"';
                        echo ' href="login">Login';
                    }
                    echo '</a>';
                ?>
            </li>
        </ul>
    </div></div>
